package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;


/**
 * The persistent class for the ORGANIZATION_AREA database table.
 * 
 */
@Entity
@Table(name="ORGANIZATION_AREA")
@NamedQuery(name="OrganizationArea.findAll", query="SELECT o FROM OrganizationArea o")
public class OrganizationArea implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="ORGANIZATION_AREA_ORGAREAID1_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ORGANIZATION_AREA_ORGAREAID1_GENERATOR")
	@Column(name="ORGAREA_ID1")
	private long orgareaId1;

	@Column(name="ORGAREA_NAME")
	private String orgareaName;

	@Column(name="ORGAREA_REMARK")
	private String orgareaRemark;

	//bi-directional many-to-one association to Organization
	@OneToMany(mappedBy="organizationArea")
	@JSONField(serialize=false)
	private List<Organization> organizations;

	//bi-directional many-to-one association to Area
	@ManyToOne
	@JoinColumn(name="AREA_ID")
	private Area area;

	//bi-directional many-to-one association to OrganizationStructure
	@ManyToOne
	@JoinColumn(name="ORGANS_ID")
	private OrganizationStructure organizationStructure;

	//bi-directional many-to-one association to PlaceWork
	@OneToMany(mappedBy="organizationArea")
	@JSONField(serialize=false)
	private List<PlaceWork> placeWorks;

	//bi-directional many-to-one association to StaffInformation
	@OneToMany(mappedBy="organizationArea")
	@JSONField(serialize=false)
	private List<StaffInformation> staffInformations;

	public OrganizationArea() {
	}

	public long getOrgareaId1() {
		return this.orgareaId1;
	}

	public void setOrgareaId1(long orgareaId1) {
		this.orgareaId1 = orgareaId1;
	}

	public String getOrgareaName() {
		return this.orgareaName;
	}

	public void setOrgareaName(String orgareaName) {
		this.orgareaName = orgareaName;
	}

	public String getOrgareaRemark() {
		return this.orgareaRemark;
	}

	public void setOrgareaRemark(String orgareaRemark) {
		this.orgareaRemark = orgareaRemark;
	}

	public List<Organization> getOrganizations() {
		return this.organizations;
	}

	public void setOrganizations(List<Organization> organizations) {
		this.organizations = organizations;
	}

	public Organization addOrganization(Organization organization) {
		getOrganizations().add(organization);
		organization.setOrganizationArea(this);

		return organization;
	}

	public Organization removeOrganization(Organization organization) {
		getOrganizations().remove(organization);
		organization.setOrganizationArea(null);

		return organization;
	}

	public Area getArea() {
		return this.area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	public OrganizationStructure getOrganizationStructure() {
		return this.organizationStructure;
	}

	public void setOrganizationStructure(OrganizationStructure organizationStructure) {
		this.organizationStructure = organizationStructure;
	}

	public List<PlaceWork> getPlaceWorks() {
		return this.placeWorks;
	}

	public void setPlaceWorks(List<PlaceWork> placeWorks) {
		this.placeWorks = placeWorks;
	}

	public PlaceWork addPlaceWork(PlaceWork placeWork) {
		getPlaceWorks().add(placeWork);
		placeWork.setOrganizationArea(this);

		return placeWork;
	}

	public PlaceWork removePlaceWork(PlaceWork placeWork) {
		getPlaceWorks().remove(placeWork);
		placeWork.setOrganizationArea(null);

		return placeWork;
	}

	public List<StaffInformation> getStaffInformations() {
		return this.staffInformations;
	}

	public void setStaffInformations(List<StaffInformation> staffInformations) {
		this.staffInformations = staffInformations;
	}

	public StaffInformation addStaffInformation(StaffInformation staffInformation) {
		getStaffInformations().add(staffInformation);
		staffInformation.setOrganizationArea(this);

		return staffInformation;
	}

	public StaffInformation removeStaffInformation(StaffInformation staffInformation) {
		getStaffInformations().remove(staffInformation);
		staffInformation.setOrganizationArea(null);

		return staffInformation;
	}

}